package com.fangyi.yunmusic.utils;

import java.io.File;

/**
 * 工具类，用于获取文件具体路径
 */
public class FileServerUtils {

    private static final String AVATAR = "avatar";
    private static final String SONG = "song";
    private static final String COVER = "cover";
    private static final String PLAYLIST = "playlist";
    private static final String ALBUM = "album";
    private static final String ARTIST= "artist";

    private static final String JPG = ".jpg";
    private static final String MP3 = ".mp3";

    private static final String SEPARATOR = "/";

    public static String getUserAvatarUrl(String fileServer, String avatarImgId) {
        return fileServer + SEPARATOR + AVATAR + SEPARATOR + avatarImgId + JPG;
    }

    public static String getPlaylistCoverUrl(String fileServer, String coverImgId) {
        return fileServer + SEPARATOR + COVER + SEPARATOR + PLAYLIST + SEPARATOR
                + coverImgId + JPG;
    }
    public static String getArtistPicUrl(String fileServer, String picUrlId) {
        return fileServer + SEPARATOR + COVER + SEPARATOR + ARTIST + SEPARATOR
                + picUrlId + JPG;
    }

    public static String getSongUrl(String fileServer, String songUrlId) {
        return fileServer + SEPARATOR + SONG + SEPARATOR + songUrlId + MP3;
    }

    public static String getAlbumCoverUrl(String fileServer, String coverImgId) {
        return fileServer + SEPARATOR + COVER + SEPARATOR + ALBUM + SEPARATOR
                + coverImgId + JPG;
    }
}
